//**************************************************************//
//  Effect File exported by RenderMonkey 1.6
//
//  - Although many improvements were made to RenderMonkey FX  
//    file export, there are still situations that may cause   
//    compilation problems once the file is exported, such as  
//    occasional naming conflicts for methods, since FX format 
//    does not support any notions of name spaces. You need to 
//    try to create workspaces in such a way as to minimize    
//    potential naming conflicts on export.                    
//    
//  - Note that to minimize resulting name collisions in the FX 
//    file, RenderMonkey will mangle names for passes, shaders  
//    and function names as necessary to reduce name conflicts. 
//**************************************************************//

//--------------------------------------------------------------//
// Textured
//--------------------------------------------------------------//
//--------------------------------------------------------------//
// Pass 0
//--------------------------------------------------------------//
string Textured_Pass_0_Model : ModelData = "..\\..\\..\\Programme\\RenderMonkey\\Examples\\Media\\Models\\Sphere.3ds";

float4x4 matViewProjection;
float4x4 World;
float4x4 View;


struct VS_INPUT 
{
   float4 Position : POSITION0;
   float2 Texcoord : TEXCOORD0;
   
};

struct VS_OUTPUT 
{
   float4 Position : POSITION0;
   float2 Texcoord : TEXCOORD0;
   
};

VS_OUTPUT Textured_Pass_0_Vertex_Shader_vs_main( VS_INPUT Input )
{
   VS_OUTPUT Output;

   float4 worldPosition = mul(Input.Position, World);
   float4 viewPosition = mul(worldPosition, View);
   Output.Position = mul( viewPosition, matViewProjection );
   Output.Texcoord = Input.Texcoord;

   return( Output );
   
}




float Schachfeld
<
   string UIName = "Schachfeld";
   string UIWidget = "Numeric";
   bool UIVisible =  false;
   float UIMin = -1.00;
   float UIMax = 0.00;
> = float( 0.11 );

struct PS_INPUT 
{
   float2 Texcoord : TEXCOORD0;
   
};

float4 Textured_Pass_0_Pixel_Shader_ps_main( PS_INPUT Input ) : COLOR0
{
   float halbesSchachfeld = Schachfeld/2.0f;
   
   if ((Input.Texcoord.x % Schachfeld) > halbesSchachfeld)
   {
      if ((Input.Texcoord.y % Schachfeld) > halbesSchachfeld)
      return float4(0.0f, 0.0f, 0.0f, 0.0f);
      else 
      return float4 (1.0f, 1.0f, 1.0f, 0.0f);
   }
   
   else
   {
      if ((Input.Texcoord.y % Schachfeld) > halbesSchachfeld)
      return float4(1.0f, 1.0f, 1.0f, 0.0f);
      else 
      return float4 (0.0f, 0.0f, 0.0f, 0.0f);
   }
}




//--------------------------------------------------------------//
// Technique Section for Textured
//--------------------------------------------------------------//
technique Textured
{
   pass Pass_0
   {
      VertexShader = compile vs_2_0 Textured_Pass_0_Vertex_Shader_vs_main();
      PixelShader = compile ps_2_0 Textured_Pass_0_Pixel_Shader_ps_main();
   }

}

